package cn.fl.spl.transform;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.spl.vo.SplAppOpinionReactionVO;
import fl.mongo.facade.spl.dto.SplAppOpinionReactionDTO;

import java.util.ArrayList;
import java.util.List;

public class SplAppOpinionReactionVOTransform {

    /**
     *  VO转DTO
     * @param vo
     * @return
     */
    public static SplAppOpinionReactionDTO toDTO(SplAppOpinionReactionVO vo) {
        SplAppOpinionReactionDTO dto = null ;
        if(null != vo){
            dto = new SplAppOpinionReactionDTO() ;
            dto.setId(vo.getId());
            dto.setCrtTm(vo.getCrtTm());
            dto.setCrtUsrId(vo.getCrtUsrId());
            dto.setMdfTm(vo.getMdfTm());
            dto.setMdfUsrId(vo.getMdfUsrId());
            dto.setIsDel(vo.getIsDel());
            dto.setIsValid(vo.getIsValid());
            dto.setMdfTm(vo.getMdfTm());
            dto.setMdfUsrId(vo.getMdfUsrId());
            dto.setAppSysCd(vo.getAppSysCd());
            dto.setAppVersion(vo.getAppVersion());
            dto.setEquipSysTyp(vo.getEquipSysTyp());
            dto.setOpinionDesc(vo.getOpinionDesc());
            dto.setPhone(vo.getPhone());
            dto.setUsrRlNm(vo.getUsrRlNm());
        }
        return dto ;
    }

    /**
     *  DTO转VO
     * @param dto
     * @return
     */
    public static SplAppOpinionReactionVO toVO(SplAppOpinionReactionDTO dto) {
        SplAppOpinionReactionVO vo = null ;
        if(null != dto){
            vo = new SplAppOpinionReactionVO() ;
            vo.setId(dto.getId());
            vo.setCrtTm(dto.getCrtTm());
            vo.setCrtUsrId(dto.getCrtUsrId());
            vo.setMdfTm(dto.getMdfTm());
            vo.setMdfUsrId(dto.getMdfUsrId());
            vo.setIsDel(dto.getIsDel());
            vo.setIsValid(dto.getIsValid());
            vo.setMdfTm(dto.getMdfTm());
            vo.setMdfUsrId(dto.getMdfUsrId());
            vo.setAppSysCd(dto.getAppSysCd());
            vo.setAppVersion(dto.getAppVersion());
            vo.setEquipSysTyp(dto.getEquipSysTyp());
            vo.setOpinionDesc(dto.getOpinionDesc());
            vo.setPhone(dto.getPhone());
            vo.setUsrRlNm(dto.getUsrRlNm());
        }
        return vo ;
    }

    /**
     * VO集合 转 DTO集合
     * @param list List<SplAppOpinionReactionVO>
     * @return List<SplAppOpinionReactionDTO>
     */
    public static List<SplAppOpinionReactionDTO> toDTOList(List<SplAppOpinionReactionVO> list) {
        List<SplAppOpinionReactionDTO>  dtoList = new ArrayList<SplAppOpinionReactionDTO>();
        if(CollectionUtils.isNotEmpty(list)){
            for (SplAppOpinionReactionVO vo : list) {
                dtoList.add(toDTO(vo));
            }
        }
        return dtoList;
    }

    /**
     * DTO集合 转 VO集合
     * @param list List<SplAppOpinionReactionDTO>
     * @return List<SplAppOpinionReactionVO>
     */
    public static List<SplAppOpinionReactionVO> toPOList(List<SplAppOpinionReactionDTO> list) {
        List<SplAppOpinionReactionVO>  voList = new ArrayList<SplAppOpinionReactionVO>();
        if(CollectionUtils.isNotEmpty(list)){
            for (SplAppOpinionReactionDTO dto : list) {
                voList.add(toVO(dto));
            }
        }
        return voList;
    }
}
